package cn.chen.base;

import java.lang.ref.WeakReference;

public class WeakReferenceTest {

    public static void main(String[] args) {
        WeakReference<Object> weakReference = new WeakReference<Object>(new Object());
        if(weakReference.get() != null) System.out.println("no gc");

        System.gc();

        if(weakReference.get() == null) System.out.println("gc");
        else System.out.println("no gc");
    }

}
